<?php

/**
 * @author Murat Cem YALIN <muratcem@gmail.com>
 * @copyright 2014 muratcem.com - walkerPHP.com
 * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3
 * @version 1.0.1
 */

namespace core\HTML;

class HTML implements IHTML{

    public static function radio($name, $id, $value, $label){
        return '<input type="radio" name="'.$name.'" id="'.$id.'" value="'.$value.'"><label for="'.$id.'" style="cursor:pointer">'.$label.'</label> ';
    }
    public static function option($value, $text, $selected=FALSE){
        $s = ($selected) ? ' selected="selected"' : '';
        return '<option value="'.$value.'"'.$s.'>'.$text.'</option>';
    }
    public static function image($src, $w, $h, $title='', $class='', $extra=''){
        return '<img src="'.$src.'" widh="'.$w.'" height="'.$h.'" border="0" title="'.$title.'" class="'.$class.'" '.$extra.' />';
    }
    public static function redirect($url, $sec){
        return '<meta http-equiv="refresh" content="'.$sec.'; URL='.$url.'">';
    }
    public static function utf8(){
        return '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
    }
    public static function alink($href, $text, $class='', $title='', $target=''){
        return '<a href="'.$href.'" class="'.$class.'" title="'.$title.'" target="'.$target.'">'.$text.'</a>';
    }
    public static function li($text){
        return '<li>'.$text.'</li>';
    }
    public static function ul($li){
        return '<ul>'.$li.'</ul>';
    }
    public static function div($innerHTML, $class='', $id=''){
        return '<div'.($class != '' ? ' class="'.$class.'"' : '').($id != '' ? ' id="'.$id.'"' : '').'>'.$innerHTML.'</div>';
    }

}